package com.javaspeak.designpatterns.go4.behavioural.visitor;

/**
 * The calling code, ApplicationVisitor calls the accept method passing in
 * a SmallShapeVisitor or BigShapeVisitor. The accept method in turn calls the
 * overloaded visit method of SmallShapevisitor or BigShapeVisitor.
 *
 * @author John Dickerson
 */
public class TriangleVisitable implements ShapeVisitable  {

    /**
     * This method is specific to SquareVisitable and is not in
     * SquareVisitable.  Note that a reference to this class is passed into
     * the accept(..) method as "this". Internally the Visitors,
     * SmallShapeVisitor and BigShapeVisitor call getCharacters() to get the
     * letter used to render the Triangle.
     *
     * @return Title of Square
     */
    String getCharacter(){

        return "T";
    }

    /* (non-Javadoc)
     * @see com.javaspeak.designpatterns.go4.behavioural.visitor.
     *      ShapeVisitable#accept(com.javaspeak.designpatterns.go4.behavioural.
     *          visitor.ShapeVisitor)
     */
    @Override
    public void accept( ShapeVisitor shapeVisitor ) {

        shapeVisitor.visit( this );
    }
}
